//
//  SGDataService.m
//  MomHelp
//
//  Created by xuguoyong on 16/8/12.
//  Copyright © 2016年 hudongkeji. All rights reserved.
//

#import "SGDataService.h"
#import "SGAddressURL.h"
#import "SGBaseHttpTool.h"
#import "GetUserInfoParm.h"
#import "UserInfoModel.h"
#import "CacheSqliteTool.h"
@implementation SGDataService

+ (void)userInfoWithParam:(GetUserInfoParm *)param showHUD:(BOOL)hud success:(void (^)(UserInfoModel * infoModel))success failure:(void (^)(NSError *))failure
{
   
    [self getWithUrl:GET_Userinfo_URL param:param resultClass:[UserInfoModel class] showResultMessage:YES showHUD:hud success:^(UserInfoModel *resultModel,id responseObj) {
        success(resultModel);
       [CacheSqliteTool saveHomeStatusDictArray:responseObj accessToken:responseObj[@"token"] user_id:resultModel.user_id];
   
   } failure:^(NSError *error, NSString *errorCode, NSString *remark) {
       if (failure) {
           failure(error);
       }
    
   }];

}


@end
